package com.sm.service;

import com.sm.dao.UserBankCardMapper;
import com.sm.model.UserBankCard;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.List;

@Service
public class UserBankCardService {
    @Autowired
    private UserBankCardMapper userBankCardMapper;

    public UserBankCard selectAll(Integer userId){
       return userBankCardMapper.selectAll(userId);
    }

    public int updateById(UserBankCard userBankCard){
        userBankCard.setUpdateTime(new Date());
        int i = userBankCardMapper.updateBank(userBankCard);
        return i;
    }

    public int insertBank(UserBankCard userBankCard){
        userBankCard.setCreateTime(new Date());
        userBankCard.setUpdateTime(new Date());
        int a = userBankCardMapper.insertBank(userBankCard);
        return a;
    }
}
